Skip to content

Feature/kleinanzeigen new#292

Open
orangecoding wants to merge 8 commits intomasterfrom
feature/kleinanzeigen_new
Open

Feature/kleinanzeigen new#292
orangecoding wants to merge 8 commits intomasterfrom
feature/kleinanzeigen_new

Conversation

@orangecoding
Copy link
Copy Markdown
Owner

This implements a generic method for provider to fetch details.

This pr is based on the initial work of @realDayaa.

image

@realDayaa
Copy link
Copy Markdown
Contributor

I think there is some merit in providing separate toggles for each provider for fine grained control.

realDayaa

This comment was marked as duplicate.

Copy link
Copy Markdown
Contributor

@realDayaa realDayaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments


function toAbsoluteLink(link) {
if (!link) return null;
return link.startsWith('http') ? link : `https://www.kleinanzeigen.de${link}`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Javascript URL object instead to construct.


const locality = cleanText(address.addressLocality);
const region = cleanText(address.addressRegion);
const postalCode = cleanText(address.postalCode);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the description is stored in #viewad-description-text it can probably be treated the same as the address.

if (!userId || !getUserSettings(userId)?.provider_details) {
return newListings;
}
return Promise.all(newListings.map((listing) => this._providerConfig.fetchDetails(listing, this._browser)));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs all requests in parallel, right? Isn't it better to run them sequentially to avoid rate limiting?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good arguemnt. will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants